package com.changgou.goods.code;

import com.changgou.entity.ResultCode;

/**
 * @ClassName GoodsCode
 * @Auther: Jiang YiLin
 * @Date: 2019/11/26  20:31
 * @Description:
 */
public enum  GoodsCode implements ResultCode {

    GOODS_NOT_FOUND(false,30001,"当前商品不存在"),
    GOODS_DELETED(false,30002,"当前商品处于删除状态"),
    GOODS_NEED_OFF_SHELVES(false,30003,"必须先下架再删除");

    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;

    GoodsCode(boolean success,int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }
    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
